class Solution {
    public int longestContinuousSubstring(String s) {
        int ret = 1;
        int cur = 0;
        while (cur < s.length()) {
            char c = s.charAt(cur++);
            int len = 1;
            while (cur < s.length()) {
                char next = s.charAt(cur);
                if (next != c + 1) break;
                cur++;
                c = next;
                len++;
            }
            ret = Math.max(ret, len);
        }
        return ret;
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        System.out.println(solution.longestContinuousSubstring("pcfftiovoygwwncfgews"));
    }
}